/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package GUI;


import Fachada.Fachada;

/**
 *
    * @author Prii
 */
public class TelaPrincipal1 extends javax.swing.JDialog {

    /**
     * Creates new form TelaPrincipal1
     */
    public TelaPrincipal1() {
        initComponents();
    }
    
    Fachada fachada = new Fachada();
    
   
    CadastroArbitro1 telaCadArbitro;
    CadastroEstadio1 telaCadEstadio;
    CadastroCopa1 telaCadCopa;
    CadastroPais telaCadPais;
    CadastroSumulaJogo1 telaCadSumula;
   
    PesquisarArbitro telaPesArbitro;
    PesquisarEstadio telaPesEstadio;
    PesquisaCopa telaPesCopa;
    //falta criar a classe Pesquisa sumula
    PesquisaPais telaPesPais;
    PesquisaSumula telaPesSumula;
   
    private TelaPrincipal1(boolean b) {
        throw new UnsupportedOperationException("Not yet implemented");
    }
    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem4 = new javax.swing.JMenuItem();
        jMenuItem5 = new javax.swing.JMenuItem();
        jMenuBar2 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();
        jMenuItem2 = new javax.swing.JMenuItem();
        jProgressBar1 = new javax.swing.JProgressBar();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMCadastro = new javax.swing.JMenu();
        jMCopa = new javax.swing.JMenuItem();
        jMEstadios = new javax.swing.JMenuItem();
        jMPais = new javax.swing.JMenuItem();
        jMArbitro = new javax.swing.JMenuItem();
        jMSumula = new javax.swing.JMenuItem();
        jMPesquisas = new javax.swing.JMenu();
        jMCopa1 = new javax.swing.JMenuItem();
        jMPais1 = new javax.swing.JMenuItem();
        jMEstadio1 = new javax.swing.JMenuItem();
        jMArbitro1 = new javax.swing.JMenuItem();
        jMSumula1 = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMSair = new javax.swing.JMenuItem();

        jMenuItem1.setText("jMenuItem1");

        jMenuItem4.setText("jMenuItem4");

        jMenuItem5.setText("jMenuItem5");

        jMenu1.setText("File");
        jMenuBar2.add(jMenu1);

        jMenu2.setText("Edit");
        jMenuBar2.add(jMenu2);

        jMenuItem2.setText("jMenuItem2");

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);

        jMCadastro.setText("Cadastros");

        jMCopa.setText("COPA");
        jMCopa.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMCopaActionPerformed(evt);
            }
        });
        jMCadastro.add(jMCopa);

        jMEstadios.setText("ESTADIOS");
        jMEstadios.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMEstadiosActionPerformed(evt);
            }
        });
        jMCadastro.add(jMEstadios);

        jMPais.setText("PAIS");
        jMPais.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMPaisActionPerformed(evt);
            }
        });
        jMCadastro.add(jMPais);

        jMArbitro.setText("ARBITROS");
        jMArbitro.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMArbitroActionPerformed(evt);
            }
        });
        jMCadastro.add(jMArbitro);

        jMSumula.setText("SUMULA");
        jMSumula.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMSumulaActionPerformed(evt);
            }
        });
        jMCadastro.add(jMSumula);

        jMenuBar1.add(jMCadastro);

        jMPesquisas.setText("Pesquisas");

        jMCopa1.setText("COPA");
        jMCopa1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMCopa1ActionPerformed(evt);
            }
        });
        jMPesquisas.add(jMCopa1);

        jMPais1.setText("PAIS");
        jMPais1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMPais1ActionPerformed(evt);
            }
        });
        jMPesquisas.add(jMPais1);

        jMEstadio1.setText("ESTADIOS");
        jMEstadio1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMEstadio1ActionPerformed(evt);
            }
        });
        jMPesquisas.add(jMEstadio1);

        jMArbitro1.setText("ARBITROS");
        jMArbitro1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMArbitro1ActionPerformed(evt);
            }
        });
        jMPesquisas.add(jMArbitro1);

        jMSumula1.setText("SUMULA");
        jMSumula1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMSumula1ActionPerformed(evt);
            }
        });
        jMPesquisas.add(jMSumula1);

        jMenuBar1.add(jMPesquisas);

        jMenu3.setText("Sair do programa");

        jMSair.setText("Sair");
        jMSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMSairActionPerformed(evt);
            }
        });
        jMenu3.add(jMSair);

        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 400, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 279, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMPais1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMPais1ActionPerformed
        // Tela Pesquisa Pais
        if(telaPesPais == null)
            telaPesPais = new PesquisaPais(null, true);
        telaPesPais.setVisible(true);
    }//GEN-LAST:event_jMPais1ActionPerformed

    private void jMPaisActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMPaisActionPerformed
        // Cadastro novo Pais
        if(telaCadPais==null)
            telaCadPais = new CadastroPais(null, true);
        telaCadPais.updateTela(); //atualiza os componentes da tela antes de torna-la visível 
        telaCadPais.setVisible(true);
    }//GEN-LAST:event_jMPaisActionPerformed

    private void jMArbitroActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMArbitroActionPerformed
       // Cadastro novo Arbitro
        if(telaCadArbitro==null)
            telaCadArbitro = new CadastroArbitro1(null, true);
        telaCadArbitro.updateTela(); //atualiza os componentes da tela antes de torna-la visível 
        telaCadArbitro.setVisible(true);
        
    }//GEN-LAST:event_jMArbitroActionPerformed

    private void jMSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMSairActionPerformed
        //Sair do Sistema
        System.exit(0);
    }//GEN-LAST:event_jMSairActionPerformed

    private void jMCopaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMCopaActionPerformed
       // Cadastro nova Copa
        if(telaCadCopa==null)
            telaCadCopa = new CadastroCopa1(null, true);
        telaCadCopa.updateTela(); //atualiza os componentes da tela antes de torna-la visível 
        telaCadCopa.setVisible(true);
        
    }//GEN-LAST:event_jMCopaActionPerformed

    private void jMArbitro1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMArbitro1ActionPerformed
          // Tela Pesquisa Arbitro
        if(telaPesArbitro == null)
            telaPesArbitro = new PesquisarArbitro(null, true);
        telaPesArbitro.setVisible(true);
        
    }//GEN-LAST:event_jMArbitro1ActionPerformed

    private void jMEstadio1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMEstadio1ActionPerformed
          // Tela Pesquisa Estadio
        if(telaPesEstadio==null)
            telaPesEstadio = new PesquisarEstadio(null, true);
        telaPesEstadio.setVisible(true);
        
    }//GEN-LAST:event_jMEstadio1ActionPerformed

    private void jMEstadiosActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMEstadiosActionPerformed
        // Cadastra novo Estadio
        if(telaCadEstadio==null)
            telaCadEstadio = new CadastroEstadio1(null, true);
        telaCadEstadio.setVisible(true);
    }//GEN-LAST:event_jMEstadiosActionPerformed

    private void jMCopa1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMCopa1ActionPerformed
          // Tela Pesquisa Copa
        if(telaPesCopa == null)
            telaPesCopa = new PesquisaCopa(null, true);
        telaPesCopa.setVisible(true);
        
    }//GEN-LAST:event_jMCopa1ActionPerformed

    private void jMSumulaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMSumulaActionPerformed
         // Cadastra uma nova Sumula
        if(telaCadSumula==null)
            telaCadSumula = new CadastroSumulaJogo1(null, true);
        telaCadSumula.updateTela(); //atualiza os componentes da tela antes de torna-la visível 
        telaCadSumula.setVisible(true);
    }//GEN-LAST:event_jMSumulaActionPerformed

    private void jMSumula1ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMSumula1ActionPerformed
       // Tela Pesquisa Sumula
        if(telaPesSumula == null)
            telaPesSumula = new PesquisarArbitro(null, true);
        telaPesSumula.setVisible(true);
    }//GEN-LAST:event_jMSumula1ActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /*
         * Set the Nimbus look and feel
         */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /*
         * If Nimbus (introduced in Java SE 6) is not available, stay with the
         * default look and feel. For details see
         * http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(TelaPrincipal1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(TelaPrincipal1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(TelaPrincipal1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(TelaPrincipal1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /*
         * Create and display the dialog
         */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                TelaPrincipal1 dialog = new TelaPrincipal1(true);
                dialog.addWindowListener(new java.awt.event.WindowAdapter() {

                    @Override
                    public void windowClosing(java.awt.event.WindowEvent e) {
                        System.exit(0);
                    }
                });
                dialog.setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem jMArbitro;
    private javax.swing.JMenuItem jMArbitro1;
    private javax.swing.JMenu jMCadastro;
    private javax.swing.JMenuItem jMCopa;
    private javax.swing.JMenuItem jMCopa1;
    private javax.swing.JMenuItem jMEstadio1;
    private javax.swing.JMenuItem jMEstadios;
    private javax.swing.JMenuItem jMPais;
    private javax.swing.JMenuItem jMPais1;
    private javax.swing.JMenu jMPesquisas;
    private javax.swing.JMenuItem jMSair;
    private javax.swing.JMenuItem jMSumula;
    private javax.swing.JMenuItem jMSumula1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuBar jMenuBar2;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem4;
    private javax.swing.JMenuItem jMenuItem5;
    private javax.swing.JProgressBar jProgressBar1;
    // End of variables declaration//GEN-END:variables
}
//comentário